{if $ajaxRelocate}
	{literal}
		<script type="text/javascript">
			function loginSubmit() {
				var options = {
					target: "#messageBox",
					url:  $("#login-form").attr("action")
				};
				$("#login-form").ajaxSubmit(options);
				return false;
			}
			$("input[type='checkbox']").jqTransCheckBox();
		</script>
	{/literal}
{/if}

{if $shopping_cart && $logged_in}
	<script language="JavaScript" type="text/javascript" src="{$GLOBALS.site_url}/system/ext/jquery/jquery-ui.js"></script>
	<script>
		{literal}
			 $("#shoppingCartForm").click();
		{/literal}
	</script>
{/if}

{if !$GLOBALS.is_ajax}<h1 class="header-hide">[[Sign In]]</h1>{/if}
{include file="errors.tpl" errors=$errors}
<form action="{$GLOBALS.site_url}/login/" method="post" class="loginForm" {if $ajaxRelocate} id="login-form" onsubmit="return loginSubmit()" {/if}>
	<input type="hidden" name="return_url" value="{$return_url}" />
	<input type="hidden" name="action" value="login" />
	{if $shopping_cart}<input type="hidden" name="shopping_cart" value="{$shopping_cart}" />{/if}
	{if $ajaxRelocate}<input type="hidden" name="ajaxRelocate" value="1" />{/if}
	<fieldset>
		<div class="inputName header-hide">[[Username]]</div>
		<div class="inputField"><input class="username" type="text" name="username" /></div>
	</fieldset>
	<fieldset>
		<div class="inputName header-hide">[[Password]]</div>
		<div class="inputField"><input class="password" type="password" name="password" /></div>
	</fieldset>
	<fieldset class="header-hide">
		<div class="inputName">&nbsp;</div>
		<div class="inputField"><input type="checkbox" name="keep" /> [[Keep me signed in]]</div>
	</fieldset>
	<fieldset>
		<div class="inputName header-hide">&nbsp;</div>
		<div class="inputButton"><input type="submit" value="[[Login]]" class="button" /></div>
	</fieldset>
</form>
<div class="clr"></div>

<span class="header-hide"><a href="{$GLOBALS.site_url}/password-recovery/">[[Forgot Your Password?]]</a>&nbsp;|&nbsp;</span> <a href="{$GLOBALS.site_url}/registration/">[[Sign Up]]</a>

<div class="soc_reg_form">{module name="social" function="social_plugins"}</div>

<script type="text/javascript">
	{literal}
	$(function() {
		//*** Placeholder for Username ***//
		$("#header-right .username").val('{/literal}[[Username]]{literal}');

		$(".loginForm").submit(function(){
			if ($("#header-right .username").val()=='{/literal}[[Username]]{literal}')
			{
				$("#header-right .username").val('');
			}
		});

		$("#header-right .username").focus(function(){
			if ($("#header-right .username").val()=='{/literal}[[Username]]{literal}')
			{
				$("#header-right .username").val('');
			}
		});

		$("#header-right .username").blur(function(){
			if ($("#header-right .username").val()=='')
			{
				$("#header-right .username").val('{/literal}[[Username]]{literal}');
			}
		});
		//*** Placeholder for Password ***//
		$("#header-right .password").val('{/literal}[[Password]]{literal}');

		$(".loginForm").submit(function(){
			if ($("#header-right .password").val()=='{/literal}[[Password]]{literal}')
			{
				$("#header-right .password").val('');
			}
		});

		$("#header-right .password").focus(function(){
			if ($("#header-right .password").val()=='{/literal}[[Password]]{literal}')
			{
				$("#header-right .password").val('');
				$("#header-right .password").get(0).type='password';
			}
		});

		$("#header-right .password").blur(function(){
			if ($("#header-right .password").val()=='')
			{
				$("#header-right .password").val('{/literal}[[Password]]{literal}');
				$("#header-right .password").get(0).type='text';
			}
		});
	});
	{/literal}
</script>
